<?php
	include_once("include/config.php");
	include_once("include/auth.lib.php");
	include_once("include/functions.php");

	list($status, $user) = auth_get_status();

	if ($status == AUTH_LOGGED) {
	
		$IdPalestra = $user['id_palestra'];
		
		$CognomeNome = $_POST["COGNOMENOME"];
		$Categoria = $_POST["CATEGORIA"];
		$Peso = $_POST["PESO"];
		
		if (countRec('*', 'atleti') >= MAX_ISCRIZIONI) {
			die("max-error");
		}
		
		add($IdPalestra, $CognomeNome, $Categoria, $Peso);
	
	}
?>	

